package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SceneryareaMapper;
import com.ruoyi.system.domain.Sceneryarea;
import com.ruoyi.system.service.ISceneryareaService;
import com.ruoyi.common.core.text.Convert;

/**
 * 景区Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-15
 */
@Service
public class SceneryareaServiceImpl implements ISceneryareaService 
{
    @Autowired
    private SceneryareaMapper sceneryareaMapper;

    /**
     * 查询景区
     * 
     * @param id 景区ID
     * @return 景区
     */
    @Override
    public Sceneryarea selectSceneryareaById(Long id)
    {
        return sceneryareaMapper.selectSceneryareaById(id);
    }

    /**
     * 查询景区列表
     * 
     * @param sceneryarea 景区
     * @return 景区
     */
    @Override
    public List<Sceneryarea> selectSceneryareaList(Sceneryarea sceneryarea)
    {
        return sceneryareaMapper.selectSceneryareaList(sceneryarea);
    }

    /**
     * 新增景区
     * 
     * @param sceneryarea 景区
     * @return 结果
     */
    @Override
    public int insertSceneryarea(Sceneryarea sceneryarea)
    {
        return sceneryareaMapper.insertSceneryarea(sceneryarea);
    }

    /**
     * 修改景区
     * 
     * @param sceneryarea 景区
     * @return 结果
     */
    @Override
    public int updateSceneryarea(Sceneryarea sceneryarea)
    {
        sceneryarea.setUpdateTime(DateUtils.getNowDate());
        return sceneryareaMapper.updateSceneryarea(sceneryarea);
    }

    /**
     * 删除景区对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSceneryareaByIds(String ids)
    {
        return sceneryareaMapper.deleteSceneryareaByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除景区信息
     * 
     * @param id 景区ID
     * @return 结果
     */
    @Override
    public int deleteSceneryareaById(Long id)
    {
        return sceneryareaMapper.deleteSceneryareaById(id);
    }
}
